// @ts-ignore
import axiosInstance from "~/api";

export const getRandomArticle = (params: any) => {
    return axiosInstance.get('/articles/random', {
        params
    })
}
export const getArticles = (params: any) => {
    return axiosInstance.get('/articles/all', {params: params})
}

export const getTopArticleList = () => {
    return axiosInstance.get('/articles/top/list')
}

export const getArticlePublish = () => {
    return axiosInstance.get('/articles/publish')
}

export const getBookPublish = () => {
    return axiosInstance.get('/books/publish')
}

export const getAllTags = () => {
    return axiosInstance.get('/tags/all')
}

export const getArticleById = (articleId: any) => {
    return axiosInstance.get('/articles/' + articleId)
}

export const getAllArchives = (params: any) => {
    return axiosInstance.get('/archives/all', {params: params})
}

export const getArticleByCategory = () => {
    return axiosInstance.get('/articles/category/list')
}

export const getArticlesByTagId = (params: any) => {
    return axiosInstance.get('/articles/tagId', {params: params})
}
